// 宿管管理页面请求api
import httpInstance from './http'

// 1、获取所有宿管信息数据api
export const getAllDMDataApi = () => {
    return httpInstance.get('/allDMDatas');
}

// 2、添加宿管信息api
export const addDMInfosApi = (data) => {
    return httpInstance.post('/addDMInfos', {
        data
    })
}

// 3、删除宿管信息api
export const deleteDMInfosApi = (id) => {
    return httpInstance.delete('/deleteDMInfos', {
       params: { id }
    })
}

// 4、根据id值获取宿管信息
export const getEditInfoApi = (id) => {
    return httpInstance.get('/getDMInfos', {
        params: { id }
    })
}

// 5、提交表单数据
export const submitFormApi = (ruleForm) => {
    return httpInstance.put('/editDMInfos', {
        data: ruleForm
    })
}

// 6、搜索api
export const searchInfoApi = (key, value) => {
    return httpInstance.get('/search_info', {
        params: { key, value }
    })
}

// 7、批量删除api
export const deleteMoreApi = (ids) => {
    return httpInstance.delete('/delete_more', {
        params: { "ids": ids }
    })
}

// 8、修改状态值
export const updateStatusApi = (id, value) => {
    return httpInstance.put('/update_status', {
        id, value
    })
}